package com.goldplusgold.tradedelay.app.trade.networkservice;

import com.goldplusgold.network.lib.annotation._HTTP_DELETE;
import com.goldplusgold.network.lib.annotation._HTTP_GET;
import com.goldplusgold.network.lib.annotation._HTTP_PARAM;
import com.goldplusgold.network.lib.annotation._HTTP_POST;
import com.goldplusgold.network.lib.annotation._HTTP_PUT;
import com.goldplusgold.network.lib.annotation._HTTP_URL;
import com.goldplusgold.tradedelay.app.trade.pojo.Customer;
import com.goldplusgold.tradedelay.app.trade.pojo.EntrustList;
import com.goldplusgold.tradedelay.app.trade.pojo.EntrustStatus;
import com.goldplusgold.tradedelay.app.trade.pojo.MyAssets;
import com.goldplusgold.tradedelay.app.trade.pojo.OrderResult;
import com.goldplusgold.tradedelay.app.trade.pojo.PositionAmount;
import com.goldplusgold.tradedelay.app.trade.pojo.PositionList;
import com.goldplusgold.tradedelay.app.trade.pojo.PositionType;
import com.goldplusgold.tradedelay.app.trade.pojo.ProfitAndLoss;
import com.goldplusgold.tradedelay.app.trade.pojo.Switch;
import com.goldplusgold.tradedelay.app.trade.pojo.TradeList;
import com.goldplusgold.tradedelay.app.trade.pojo.TriggeredRecordList;

import java.util.List;

/**
 * Created by admin on 2017/5/18.
 */

public interface ApiTrade {
    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._POSITION_URL)
    PositionList getPositionList(@_HTTP_PARAM("prodCode")
                                         String prodCode) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._ENTRUST_URL)
    EntrustList getEntrustList(@_HTTP_PARAM("currentPage")
                                       String currentPage,
                               @_HTTP_PARAM("queryNum")
                                       String queryNum) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._CANCEL_ENTRUST_URL)
    EntrustStatus getEntrustStatus(@_HTTP_PARAM("orderNo")
                                           String orderNo) throws Exception;


    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._TRADE_TYPE_URL)
    PositionType getTradeType(@_HTTP_PARAM("prodCode")
                                      String prodCode) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._POSITION_AMOUNT_URL)
    List<PositionAmount> queryPositonAmount() throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._POSITION_AMOUNT_URL)
    List<PositionAmount> queryPositonAmount(@_HTTP_PARAM("prodCode")
                                                    String prodCode) throws Exception;

    @_HTTP_POST
    @_HTTP_URL(url = ApiConfig._ORDER_TRANSACTION_URL)
    OrderResult orderTransaction(@_HTTP_PARAM("tradeType") String tradeType,
                                 @_HTTP_PARAM("prodCode") String prodCode,
                                 @_HTTP_PARAM("price") String price,
                                 @_HTTP_PARAM("volume") String volume) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._TRADE_URL)
    TradeList getTradeList(@_HTTP_PARAM("currentPage")
                                   String currentPage,
                           @_HTTP_PARAM("queryNum")
                                   String queryNum) throws Exception;


    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._CASH_URL)
    MyAssets getMyAssets() throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._CUSTOMER_URL)
    Customer getCustomer() throws Exception;

    @_HTTP_POST
    @_HTTP_URL(url = ApiConfig._PROFIT_LOSS_ADD_URL)
    ProfitAndLoss addProfitAndLossItem(@_HTTP_PARAM("prodCode") String proCode,
                                       @_HTTP_PARAM("bearbullType") String bearbullType,
                                       @_HTTP_PARAM("sltpType") String sltpType,
                                       @_HTTP_PARAM("sltpPrice") String sltpPrice,
                                       @_HTTP_PARAM("floatPrice") String floatPrice,
                                       @_HTTP_PARAM("lots") String lots) throws Exception;


    @_HTTP_DELETE
    @_HTTP_URL(url = ApiConfig._PROFIT_LOSS_DELETE_URL)
    ProfitAndLoss deleteProfitAndLossItem(@_HTTP_PARAM("id") String id,
                                          @_HTTP_PARAM("prodCode") String proCode,
                                          @_HTTP_PARAM("bearbullType") String bearbullType,
                                          @_HTTP_PARAM("sltpType") String sltpType
    ) throws Exception;

    @_HTTP_PUT
    @_HTTP_URL(url = ApiConfig._PROFIT_LOSS_UPDATE_URL)
    ProfitAndLoss updateProfitAndLossItem(@_HTTP_PARAM("id") String id,
                                          @_HTTP_PARAM("prodCode") String proCode,
                                          @_HTTP_PARAM("bearbullType") String bearbullType,
                                          @_HTTP_PARAM("sltpType") String sltpType,
                                          @_HTTP_PARAM("sltpPrice") String sltpPrice,
                                          @_HTTP_PARAM("floatPrice") String floatPrice,
                                          @_HTTP_PARAM("lots") String lots) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._PROFIT_NOT_TRIGGER_URL)
    TriggeredRecordList getAllNotTriggered(@_HTTP_PARAM("pageNo") String pageNo,
                                           @_HTTP_PARAM("pageSize") String pageSize) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._PROFIT_TRIGGER_URL)
    TriggeredRecordList getAllTriggered(@_HTTP_PARAM("pageNo") String pageNo,
                                        @_HTTP_PARAM("pageSize") String pageSize) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._PROFIT_SETTING_URL)
    TriggeredRecordList getSettingTriggered(@_HTTP_PARAM("prodCode") String prodCode,
                                            @_HTTP_PARAM("bearbullType") String bearbullType
    ) throws Exception;

    @_HTTP_GET
    @_HTTP_URL(url = ApiConfig._ORDER_SWITCH_URL)
    Switch getSwitch() throws Exception;

}
